package fmppc.manager.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import fmppc.basics.BasicsEntity;
import lombok.Data;
import lombok.experimental.Accessors;
import lombok.extern.slf4j.Slf4j;

import java.util.Objects;

/**
* 名称: 实体主键属性拓展抽象
* @description: 字符串UUID算法
* @author: XXSD
* @date: 2023-05-23 9:44
*/
@Data
@Slf4j
@Accessors(chain = true)
public class PropertyUuidKeyEntity<T> extends BasicsEntity<T> {

    private static final long serialVersionUID = 673270858052679374L;
    /**
     * 属性说明: 主键Key
     * @date: 2023-05-21 23:57
     */
    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        if (!super.equals(o)) {
            return false;
        }
        PropertyUuidKeyEntity<?> that = (PropertyUuidKeyEntity<?>) o;
        return Objects.equals(id, that.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), id);
    }
}
